<template>
  <div id="example">
    <!--    MD文本编辑器组件,传递属性给子组件-->
    <MDEditor :value="mdValue" :handle-change="handleMDChange" />
    <!--代码编辑器组件-->
    <CodeEditor :value="codeValue" :handle-change="handleCodeChange" />
  </div>
</template>

<script lang="ts" setup>
import MDEditor from "@/components/MDEditor.vue";
import { ref } from "vue";
import CodeEditor from "@/components/CodeEditor.vue";

const mdValue = ref("");
const codeValue = ref("");
const handleMDChange = (v: string) => {
  console.log(v);
  mdValue.value = v;
};
const handleCodeChange = (v: string) => {
  console.log(v);
  codeValue.value = v;
};
</script>
